package com.sviet.game.tetriswindow;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;

/**
 * TileView: a View-variant designed for handling arrays of "icons" or other
 * drawables.
 * 
 */
public class TetrisHudView extends View {

	private final Paint mPaint = new Paint();

	private int nextType = -1;

	private String TAG = "TetrisHudView";

	private Context context;

	public TetrisHudView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		this.context = context;
	}

	public TetrisHudView(Context context, AttributeSet attrs) {
		super(context, attrs);
		this.context = context;
	}

	public void updateNextType(int nextType) {
		Log.v(TAG , "updateNextType");
		this.nextType = nextType;
		invalidate();
	}
	
	@Override
	public void onDraw(Canvas canvas) {
		super.onDraw(canvas);

		TetrisHud.paintRightHud(context, canvas, mPaint, getRight(), getTop(), nextType);
	}

}
